package com.kifas.entity;

import java.io.Serializable;
import java.util.Date;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * @author brainmaster
 * 
 */
@Entity
@Table(name = "tb_penerimaan")
public class PenerimaanEntity implements Serializable {

	private static final long serialVersionUID = -1382643262952974711L;

	@Id
	@GeneratedValue
	@Column(name = "id_penerimaan")
	private Long idPenerimaan;

	@Column(name = "no_penerimaan")
	private String nomorPenerimaan;

	@Column(name = "id_pembelian")
	private Long idPembelian;

	@Temporal(TemporalType.TIMESTAMP)
	private Date tanggal;

	private String keterangan;

	@Column(name = "no_po")
	private String nomorPo;

	@OneToMany(mappedBy = "penerimaan", targetEntity = PenerimaanDetailEntity.class, fetch = FetchType.LAZY)
	private Set<PenerimaanDetailEntity> penerimaanDetails;

	@Column(name = "created_by")
	private String createdBy;

	@Column(name = "created_date")
	private Date createdDate;

	public PenerimaanEntity() {
	}

	public PenerimaanEntity(Long idPenerimaan, String nomorPenerimaan, Long idPembelian, Date tanggal, String keterangan, String nomorPo,
			Set<PenerimaanDetailEntity> penerimaanDetails, String createdBy, Date createdDate) {
		this.idPenerimaan = idPenerimaan;
		this.nomorPenerimaan = nomorPenerimaan;
		this.idPembelian = idPembelian;
		this.tanggal = tanggal;
		this.keterangan = keterangan;
		this.nomorPo = nomorPo;
		this.penerimaanDetails = penerimaanDetails;
		this.createdBy = createdBy;
		this.createdDate = createdDate;
	}

	public Long getIdPenerimaan() {
		return idPenerimaan;
	}

	public void setIdPenerimaan(Long idPenerimaan) {
		this.idPenerimaan = idPenerimaan;
	}

	public String getNomorPenerimaan() {
		return nomorPenerimaan;
	}

	public void setNomorPenerimaan(String nomorPenerimaan) {
		this.nomorPenerimaan = nomorPenerimaan;
	}

	public Long getIdPembelian() {
		return idPembelian;
	}

	public void setIdPembelian(Long idPembelian) {
		this.idPembelian = idPembelian;
	}

	public Date getTanggal() {
		return tanggal;
	}

	public void setTanggal(Date tanggal) {
		this.tanggal = tanggal;
	}

	public String getKeterangan() {
		return keterangan;
	}

	public void setKeterangan(String keterangan) {
		this.keterangan = keterangan;
	}

	public String getNomorPo() {
		return nomorPo;
	}

	public void setNomorPo(String nomorPo) {
		this.nomorPo = nomorPo;
	}

	public Set<PenerimaanDetailEntity> getPenerimaanDetails() {
		return penerimaanDetails;
	}

	public void setPenerimaanDetails(Set<PenerimaanDetailEntity> penerimaanDetails) {
		this.penerimaanDetails = penerimaanDetails;
	}

	public void setCreatedBy(String createdBy) {
		this.createdBy = createdBy;
	}

	public String getCreatedBy() {
		return createdBy;
	}

	public void setCreatedDate(Date createdDate) {
		this.createdDate = createdDate;
	}

	public Date getCreatedDate() {
		return createdDate;
	}

}
